package cn.swu.todolist

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper


class DBhelper(context: Context, name:String, num:Int):SQLiteOpenHelper(context,name,null,num)
{
    override fun onCreate(db: SQLiteDatabase?) {
        if (db != null) {
            db.execSQL("CREATE TABLE ${Todo.TABLE} (\n" +
                    "\t${Todo.COL_ID} integer PRIMARY KEY autoincrement,\n" +
                    "\t${Todo.COL_CONTENT} text,\n" +
                    "\t${Todo.COL_TIME} REAL)")
        }
    }

    override fun onUpgrade(p0: SQLiteDatabase?, p1: Int, p2: Int) {
        TODO("Not yet implemented")
    }

}
